home *** CD-ROM | disk | FTP | other *** search
/ s-gikan2.maizuru-ct.ac.jp / s-gikan2.maizuru-ct.ac.jp.zip / s-gikan2.maizuru-ct.ac.jp / pub / ncvc352_install.exe / {app} / scripts / LatheViewCompleteSet / change_YX_XZ.pl < prev    next >
Perl Script  |  2004-11-10  |  469b  |  29 lines

  1. #! /usr/bin/perl
  2.  
  3. # NCÉ∙ö╒ùpGâRü[âhé≡üANCVCé┼ò\Īé╖éΘé╜é▀Ä▓ò╧è╖é╖éΘâXâNâèâvâg #
  4.  
  5.  
  6. %XZ= ("Z","X","X","Y","K","I","I","J");
  7.  
  8. $pre_file= $ARGV[0];
  9. $out_file= $ARGV[1];
  10. open(IN,$pre_file);
  11. open(OUT,">$out_file");
  12.  
  13. while(<IN>){
  14.     if(!/^N?[0-9\s]*[\(\%]/){
  15.         if(/[ZXKI]/){
  16.             $new_line= "";
  17.             while(/([ZXKI])([0-9\-\.]+)/){
  18.                 $new_line= $new_line.$`.$XZ{$1}.$2;
  19.                 $_= $';
  20.             }
  21.             $_= $new_line.$_;
  22.         }
  23.     }
  24.     print OUT;
  25. }
  26.  
  27. close(OUT);
  28. close(IN);
  29.